package com.jws.jawestshow;

import android.content.Context;

import com.jws.thirdlibrary.CxManager;
import com.jws.thirdlibrary.ICustomCallback;

import android.app.Application;
import android.util.Log;

public class JawestshowApplication extends Application {
    private static Context mContext;
    private static final String TAG = "JawestshowApplication";

    @Override
    public void onCreate() {
        super.onCreate();
        Log.v(TAG, "oncreate");
        mContext = this.getBaseContext();
        initCxManager();
    }

    private void initCxManager() {
        if (mCxManager == null) {
            mCxManager = CxManager.register(mContext, new ICustomCallback() {
                @Override
                public void onCustomCallback(String s) {
                    Log.i(TAG, s );
                }
            });
        }
    }

    static CxManager mCxManager;

    public static CxManager getCxManager() {
        if (mCxManager == null) {
            mCxManager = CxManager.create(mContext);
        }
        return mCxManager;
    }
}
